import { http } from "@/api";
import { UserModel } from "@/api/model/user.model.ts";

/**
 * 登录
 */
export function login(params: { username: string, password: string }): Promise<UserModel> {
    return http({
        method: "POST",
        url: "/login",
        params
    });
}

/**
 * 登出
 */
export function logout(): Promise<void> {
    return http({
        method: "POST",
        url: "/logout"
    });
}